﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NHibData.Repository;
using StudyEnglish.Model;

namespace StudyEnglish.Service.Implementation
{
    class DictionaryService : IDictionaryService
    {
        private readonly IRepository<DictionaryItem> _dictionaryItems = RepositoryFactory.Create<DictionaryItem>();

        public IList<DictionaryItem> FindAllItems()
        {
            return _dictionaryItems.FindAll();
        }

        public DictionaryItem GetById(int rowId)
        {
            return _dictionaryItems.FindById(rowId);
        }

        public void UpdateItem(DictionaryItem level)
        {
            _dictionaryItems.SaveOrUpdate(level);
        }

        public IList<DictionaryItem> GetAllLevels()
        {
            //turn (from d in _dictionaryItems.Linq_)
            return null;
        }
    }
}
